import type { Istore } from "./entity";
import type { IPageParams } from "@/types/table";
import request from "@/api/request";

export function getPageList(params: IPageParams) {
  return request({
    url: "/admin/system/store/list",
    method: "get",
    params,
    loading: true,
  });
}
export function storeGetCountApi() {
  return request({
    url: "/admin/system/store/getCount",
    method: "get",
  });
}

export function storeDel(id: number) {
  return request({
    url: "/admin/system/store/delete",
    method: "get",
    params: { id },
  });
}
export function storeinfo(id: number) {
  return request({
    url: "/admin/system/store/info",
    params: { id },
    method: "get",
  });
}

export function storeUpdateStatusApi(params: any) {
  return request({
    url: "/admin/system/store/update/status",
    method: "get",
    params,
  });
}

export function storeAddup(data: Istore) {
  return request({
    url: `/admin/system/store/${!data.id ? "save" : "update"}`,
    method: "post",
    data,
    params: { id: data.id },
  });
}
// 城市列表
export function cityListTree() {
  return request({
    url: "/admin/system/city/list/tree",
    method: "get",
  });
}
